import React, { FC } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { Form } from 'antd-mobile';
import JYInput from '@/components/JYInput/JYInput';
export interface IProps extends ICompProps {
    name: string;
    label?: string;
    rules?: Array<object>;
    placeholder?: string;
}
FormItem.defaultProps = {
    placeholder: '请输入',
} as Partial<IProps>;
function FormItem(props: IProps) {
    const { className, style, name, label, rules, placeholder } = props;
    const localClassName = useClassName('FormItem', className);
    return (
        <RootView className={localClassName} style={style}>
            <Form.Item name={name} label={<Text className="label">{label}</Text>} rules={rules}>
                <JYInput placeholder={placeholder}></JYInput>
            </Form.Item>
        </RootView>
    );
}
export default React.memo(FormItem as FC<IProps>);
const RootView = styled(View)`
    &.FormItem {
        .label {
            font-weight: 400;
            color: #808a9d;
            font-size: 28px;
        }
    }
`;
